const { DataTypes } = require('sequelize');
const { sequelize } = require('../utils/database');

const FeedLike = sequelize.define('FeedLike', {
  id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true
  },
  user_id: {
    type: DataTypes.INTEGER,
    allowNull: false,
    comment: '点赞用户ID'
  },
  feed_id: {
    type: DataTypes.INTEGER,
    allowNull: false,
    comment: '动态ID'
  }
}, {
  tableName: 'feed_likes',
  indexes: [
    {
      fields: ['user_id']
    },
    {
      fields: ['feed_id']
    },
    {
      unique: true,
      fields: ['user_id', 'feed_id']
    }
  ]
});

module.exports = FeedLike; 